package com.financing.platform.service;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import com.financing.platform.common.Pager;
import com.financing.platform.dto.CorpProjectDTO;
import com.financing.platform.dto.FpProjectRabate;
import com.financing.platform.dto.ProductAttachmentDTO;
import com.financing.platform.dto.ProductDetailPageDTO;
import com.financing.platform.dto.ProjectDTO;
import com.financing.platform.dto.ProjectExpandDTO;
import com.financing.platform.vo.ProductVO;
import com.financing.platform.vo.ProjectSendConfirmEmailVO;
import com.financing.platform.vo.ProjectVO;

public interface IProjectService extends IBaseService {
	
	/**
	 * 
	* @Title: queryAllProject 
	* @Description: 查询产品列表
	* @param   projectDTO
	* @return List<ProjectDTO>   
	* @throws
	 */
	public List<ProjectDTO> queryAllProject(ProjectDTO projectDTO);
	
	/**
	 * 
	* @Title: queryProject 
	* @Description: 查询单个产品
	* @param   projectDTO
	* @return ProjectDTO   
	* @throws
	 */
	public ProjectDTO queryProject(ProjectDTO projectDTO);
	
	/**
	 * @throws SQLException 
	 * 
	* @Title: updateProject 
	* @Description: 更新产品
	* @param   projectDTO
	* @return int   
	* @throws
	 */
	public int updateProject(ProjectDTO projectDTO,ProjectExpandDTO projectExpandDTO) throws SQLException;

	/**
	 * @throws SQLException
	 *
	 * @Title: updateProject
	 * @Description: 更新产品
	 * @param   projectDTO
	 * @return int
	 * @throws
	 */
	public int updateProject(ProjectDTO projectDTO) throws SQLException;
	
	/**
	 * @throws SQLException 
	 * 
	* @Title: updateProjectFull 
	* @Description: 更新产品(全字段)
	* @param   projectDTO
	* @return int   
	* @throws
	 */
	public int updateProjectFull(ProjectDTO projectDTO,ProjectExpandDTO projectExpandDTO) throws SQLException;
	/**
	 * 
	 * @Title: updateProductAttachment
	 * @Description: 更新产品附件 
	 * @param @param productAttachmentDTOList
	 * @param @param productId
	 * @param @return
	 * @param @throws SQLException   
	 * @return int   
	 * @throws
	 */
	public int updateProductAttachment(List<ProductAttachmentDTO> productAttachmentDTOList,int productId) throws SQLException ;
	
	/**
	 * 
	* @Title: addProject 
	* @Description: 添加产品
	* @param   projectDTO
	* @return int   
	* @throws
	 */
	public int addProject(ProjectDTO projectDTO,CorpProjectDTO corpProjectDTO,List<ProductAttachmentDTO> productAttachmentDTOList) throws SQLException;
	
	/**
	 * 
	* @Title: addProject 
	* @Description: 添加产品
	* @param   projectDTO
	* @return int   
	* @throws
	 */
	public int addProject(ProjectDTO projectDTO,CorpProjectDTO corpProjectDTO,List<ProductAttachmentDTO> productAttachmentDTOList,String copyType,ProjectExpandDTO projectExpandDTO) throws SQLException;
	
	/**
	 * @throws SQLException 
	 * 
	* @Title: projectSet 
	* @Description: 产品成立
	* @param   project
	* @param @return    
	* @return int   
	* @throws
	 */
	public int projectSet(ProjectDTO project) throws SQLException;
	
	/**
	 * 
	* @Title: updateAllSubscription 
	* @Description: 更新产品购买信息
	* @param   projectDTO
	* @param @throws SQLException    
	* @return int   
	* @throws
	 */
	public int updateAllSubscription(ProjectDTO projectDTO) throws SQLException ;
	
	/**
	 * @throws SQLException 
	 * 
	* @Title: queryCorpProject 
	* @Description: 查询产品机构
	* @param   projectId
	* @return CorpProjectDTO   
	* @throws
	 */
	public CorpProjectDTO queryCorpProject(int projectId) throws SQLException;
	
	/**
	 * 
	* @Title: deleteProject 
	* @Description: 删除产品信息
	* @param   projectId
	* @param @throws SQLException    
	* @return int   
	* @throws
	 */
	public int deleteProject(int projectId) throws SQLException;
	
	/**
	 * 
	 * @Title: projectListForPublish
	 * @Description: 查询发布产品推荐信息 
	 * @param @param projectDTO
	 * @param @return
	 * @param @throws SQLException   
	 * @return List<ProjectVO>   
	 * @throws
	 */
	public List<ProjectVO> projectListForPublish(ProjectDTO projectDTO) throws SQLException;
	
	/**
	 * 
	 * @Title: projectListForPublishCount
	 * @Description: 查询产品列表总数 
	 * @param @param projectDTO
	 * @param @return
	 * @param @throws SQLException   
	 * @return int   
	 * @throws
	 */
	public int projectListForPublishCount(ProjectDTO projectDTO) throws SQLException;
	
	/**
	 * 
	 * @Title: queryProductAttachments
	 * @Description: 查询产品附件列表 
	 * @param @param pId
	 * @param @return
	 * @param @throws SQLException   
	 * @return List<ProductAttachmentDTO>   
	 * @throws
	 */
	public List<ProductAttachmentDTO> queryProductAttachments(Integer pId) throws SQLException;

	/**
	 *
	 * @throws
	 */
	public ProductAttachmentDTO queryProductAttachmentsForId(Integer Id) throws SQLException;

	/**
	 * queryProjectInfoByIds  根据数组id 查询产品
	 * @param array
	 * @return
	 * @throws SQLException
	 */
	public List<ProjectSendConfirmEmailVO> queryProjectInfoByIds(Integer[] array)throws SQLException;
	
	/**
	 * queryProjectInfoByIds  根据数组id 查询waichang产品
	 * @param array
	 * @return
	 * @throws SQLException
	 */
	public List<ProjectSendConfirmEmailVO> queryOutProductInfoByIds(Integer[] array)throws SQLException;
	
	/**
	 * @param projectDTO 产品
	 * @param projectExpandDTO 产品扩展
	 * @param corpProjectDTO 机构产品关联表
	 * @param copyType 复制类型（需要邮件通知）
	 * @return
	 * @throws SQLException
	 */
	public int addProduct(ProjectDTO projectDTO, ProjectExpandDTO projectExpandDTO, CorpProjectDTO corpProjectDTO,String copyType)
			throws SQLException;
	
	/**
	 * @throws SQLException 
	 * 
	* @Title: updateProjectFull 
	* @Description: 更新产品(全字段)
	* @param   projectDTO
	* @return int   
	* @throws
	 */
	public int updateProduct(ProjectDTO projectDTO,ProjectExpandDTO projectExpandDTO) throws SQLException;
	/**
	 * 插入产品流水-订阅通知、产品信息
	 */
	public int addProjectFlow(ProjectDTO projectDTO, int addType)throws SQLException;
	//查询产品收益率
	public List<FpProjectRabate> getProductProfitRebateList(Integer productId) throws SQLException ;
	
	
	/**
	 * 产品信息(包括销售、核心、成本)
	 * @param productId
	 * @return
	 */
	public ProductDetailPageDTO getProductDetailViewByprice(Integer productId) throws SQLException ;

	/**
	 *  渠道- 产品列表 总数
	 * @Title: countProductListForQD
	 * @Description: 查询产品列表
	 * @param @throws SQLException
	 * @return int
	 * @throws
	 */
	public int countProductListForQD(Map<String,Object> queryParams,Pager pager) throws SQLException;


	/**
	 *  渠道- 产品列表
	 * @Title: queryProductListForQD
	 * @Description: 查询产品列表
	 * @param @throws SQLException
	 * @return int
	 * @throws
	 */
	public List<ProductVO> queryProductListForQD(Map<String,Object> queryParams,Pager pager) throws SQLException;

	public List<Map<String,Object>> queryInvestOwner(String investOwnerName) throws SQLException;


	/**
	 *  渠道-查询产品详细
	 * @Title: queryProductQDDetail
	 * @Description: 查询产品详细
	 * @param @throws SQLException
	 * @return int
	 * @throws
	 */
	public ProductVO queryProductQDDetail(Integer pId) throws SQLException;
	/**
	 *  产品名字
	 * @Title: queryPnameByCode
	 * @Description: 根据code查询名称
	 * @param @throws SQLException
	 * @return int
	 * @throws
	 */
	public Map<String, Object>  queryPnameByCode(String pCode)throws SQLException;

}
